home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Softdisk Supreme
/
Softdisk Supreme.iso
/
pc
/
DSK Files
/
0-49
/
SD021b.dsk
/
SECTOR TRANSFER.bas
< prev
next >
Wrap
BASIC Source File
|
2003-06-12
|
4KB
|
100 lines
0 HIMEM: 5376
1 T = 0:S = 0:D = 0:C = 0:B = 0:E = 0:RWTS = 768:A$ = "": GOSUB 10000
2 CALL -936
3 PRINT : INPUT "NUMBER OF DRIVES ";DN:DN = DN -1: IF DN = 0 OR DN = 1 THEN 4: PRINT "ERROR! ILLEGAL DRIVE.": GOTO 3
4 IF NOT DN THEN 6
5 PRINT "INSERT SOURCE DISK IN DRIVE 1 AND": PRINT "INSERT DESTINATION DISK INTO DRIVE 2.": INPUT "PRESS RETURN TO CONTINUE";A$
6 PRINT : INPUT "SOURCE TRACK,SECTOR START ";T1,S1: INPUT " END (TRACK,SECTOR) ";T2,S2
7 IF T1 < = T2 THEN 8: PRINT "<CTRL-G>ERROR! END TRACK < START TRACK!": GOTO 6
8 IF T1 = T2 AND S1 < = S2 THEN 9: PRINT "<CTRL-G>ERROR! END SECTOR < THAN START SECTOR!": GOTO 6
9 PRINT : INPUT "DESTINATION TRACK,SECTOR START ";T3,S3
10 IF DN THEN 12
11 PRINT : PRINT "INSERT SOURCE DISK AND PRESS RETURN.": INPUT "";A$
12 CALL -936:TRKD = T2 -T1 +1: REM # OF TRACKS TO READ FROM (USED IN LINE 16)
14 SECT = 15: IF T1 = T2 THEN SECT = S2
15 BCNT = 100: REM GREATEST NUMBER OF SECTORS THAN CAN BE READ
16 SCOUNT = TRKD *16 -S1 -(15 -S2): REM TOTAL NUMBER OF SECTORS TO READ.
17 REM FF=0 IF THERE ARE MORE SECTORS TO BE READ FROM SOURCE DISK.
18 FF = 0: IF SCOUNT >BCNT THEN FF = 1
19 IF SCOUNT <BCNT THEN BCNT = SCOUNT
20 TEXT : CALL -936:D = 1:B = 5376
25 VTAB 1: HTAB 16: PRINT "READING"
27 REM READ GIVEN SECTORS FROM SOURCE DISK
30 T = T1:S = S1: FOR SKTCNT = 1 TO BCNT
35 VTAB 5: HTAB 1: PRINT "TRACK = ";T: VTAB 6: HTAB 1: PRINT "SECTOR= ";S;" "
36 VTAB 7: PRINT "BUFFER= ";B;" "
40 C = 0: GOSUB 20000:C = 1: GOSUB 20000
45 IF E < >0 THEN 1000
50 S = S +1: IF S <16 THEN 55
51 T = T +1:S = 0
55 IF NOT FF THEN 57
56 TT = T:TS = S
57 B = B +256: NEXT SKTCNT: REM END OF SOURCE INPUT LOOP
58 IF DN THEN 70
60 VTAB 10: INPUT "INSERT TARGET DISK AND PRESS RETURN";A$
70 POKE 34,10: CALL -936
72 VTAB 11: HTAB 16: PRINT "WRITING"
75 D = 2:B = 5376: IF NOT DN THEN D = 1
77 REM WRITE OUT TO DESTINATION DISK
80 T = T3:S = S3: FOR SKTCNT = 1 TO BCNT
85 VTAB 15: HTAB 1: PRINT "TRACK = ";T: VTAB 16: HTAB 1: PRINT "SECTOR= ";S;" "
86 VTAB 17: PRINT "BUFFER= ";B;" "
90 C = 0: GOSUB 20000:C = 2: GOSUB 20000
95 IF E < >0 THEN 1000
96 S = S +1: IF S <16 THEN 98
97 T = T +1:S = 0
98 IF NOT FF THEN 100
99 TV3 = T:TU3 = S
100 B = B +256: NEXT SKTCNT: REM END OF DESTINATION OUTPUT LOOP
105 IF NOT FF THEN 200
106 T1 = TT:S1 = TS:T3 = TV3:S3 = TU3
108 IF DN THEN 120
110 PRINT : INPUT "INSERT SOURCE DISK AND PRESS RETURN";A$
120 GOTO 12
200 TEXT : VTAB 22: PRINT "END OF TRANSFER."
205 PRINT : INPUT "ANOTHER TRANSFER (Y OR N)? ";A$: IF LEFT$(A$,1) < >"Y" THEN 9999
210 CALL -936: GOTO 5
1000 PRINT "ERROR=";E
9999 END
10000 REM <CTRL-J><CTRL-J>POKE RWTS<CTRL-J><CTRL-J>
10010 POKE 768,169: POKE 769,3: POKE 770,160: POKE 771,10: POKE 772,32: POKE 773,217: POKE 774,3: POKE 775,76: POKE 776,31:
10020 POKE 777,3: POKE 778,1: POKE 779,96: POKE 780,1: POKE 781,0: POKE 782,0: POKE 783,0: POKE 784,27: POKE 785,3:
10030 POKE 786,0: POKE 787,112: POKE 788,0: POKE 789,0: POKE 790,1: POKE 791,0: POKE 792,0: POKE 793,96: POKE 794,1:
10040 POKE 795,0: POKE 796,1: POKE 797,239: POKE 798,216: POKE 799,41: POKE 800,0: POKE 801,141: POKE 802,20: POKE 803,3:
10050 POKE 804,144: POKE 805,3: POKE 806,238: POKE 807,20: POKE 808,3: POKE 809,96
10060 REM SECTOR = 783
10070 REM TRACK = 782
10080 REM CALL = 768
10090 REM DRIVE = 780
10100 REM SLOT*16= 779
10110 REM OP = 790
10120 REM ERRCODE= 791
10130 REM ERRFLAG= 788
10140 REM OPS:W=2,R=1,INIT=4, FIND BUFFER=0
10150 REM LO BYTE OF BUFFER ADDR = 786
10160 REM HI BYTE OF BUFFER ADDR = 787
10170 RETURN
20000 POKE 783,S
20010 POKE 782,T
20020 POKE 790,C
20030 POKE 780,D
20040 POKE 779,6 *16
20050 POKE 786,0
20060 POKE 787,B/256
20070 CALL 768
20080 ERR = PEEK(788):EC = 0
20090 IF ERR THEN EC = PEEK(791)
20100 RETURN
32000 REM PROGRAMMED BY
32005 REM
32010 REM STEVE LEPISTO
32015 REM
32020 REM PHONE: (415) 369-2732
32025 REM
32030 REM 1709 JEFFERSON AVE.
32035 REM
32040 REM REDWOOD CITY,CA.94062
32045 REM
32050 REM MAY 10,1983
32055 REM <CTRL-J><CTRL-J>
32060 REM (TRANSLATED TO APPLESAUCE BY DUGYM QYCFYL. JULY 22,1983)